//
//  CommonTools.swift
//  WHWeiBo01
//
//  Created by whitcast on 16/7/10.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit


//  切换根视图控制器通知名
let SwitchRootVCNotification = "SwitchRootVCNotification"

//  当前屏幕的宽度
let ScreenWidth = UIScreen.mainScreen().bounds.size.width
//  当前屏幕的高度
let ScreenHeight = UIScreen.mainScreen().bounds.size.height
//抽取一个RGB函数
func RGB(red: CGFloat, green: CGFloat, blue: CGFloat) -> UIColor{
    return UIColor(red: red, green: green, blue: blue, alpha: 1)
}
//产生随机颜色
func RandomColor() -> UIColor {
    let red = random() % 256
    let green = random() % 256
    let blue = random() % 256
    return RGB(CGFloat(red) / 255, green: CGFloat(green) / 255, blue: CGFloat(blue) / 255)
}

//  如果函数参数提供默认值,则可以省略不传入这个参数
func printLog(title: Any, file: String = __FILE__, funcName: String = __FUNCTION__, line: Int = __LINE__) {
//    __FUNCTION__ // swift 3.0 改成#function
//    __LINE__     //             #line
//    __FILE__    //                 #file
//    
    
    #if DEBUG
    
        print("\((file as NSString).lastPathComponent)[\(line)], \(funcName)")
        print(title)
        
    #endif
    

}
